﻿namespace Smart.Utils.UI
{
    using System;
    using System.Drawing;
    using System.Windows.Forms;
    using System.Windows.Forms.Design;

    public class ImageButtonDesigner : ControlDesigner
    {
        protected override void OnPaintAdornments(PaintEventArgs pe)
        {
            ImageButton control = this.Control as ImageButton;
            if ((control != null) && (control.NormalImage == null))
            {
                Rectangle clipRectangle = pe.ClipRectangle;
                clipRectangle.Width--;
                clipRectangle.Height--;
                pe.Graphics.DrawRectangle(Pens.Gray, clipRectangle);
            }
        }
    }
}

